<%@ page language="java" contentType="text/html; charset=gb2312" session="true"%>
<%@ page import="java.io.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Login</title>
</head>
<body>
<jsp:useBean id="newUser" class="beans.UserBean" scope="page" />
<jsp:setProperty name="newUser" property="*"/>
<% 
if(newUser.getUsername()!=null&&newUser.getPassword()!=null){
	if(newUser.isUnique()){
		if(newUser.addUser()){
			out.println("Register Success!");
		} else {
			out.println("Register Failure!");
		}
	} else {
		out.println("Register Failure! User name exists!");
	}
}
%>
<a href="register.jsp">Back</a>
<a href="index.jsp">Login</a>
</body>
</html>